#!/usr/bin/gnuplot -persist
load 'graficos.gnuplot'

set key right
set logscale y
set output 'error-relativo.eps'
set title  "Errores relativos de los algoritmos en los primeros 20 términos"
set xlabel "Término"
set ylabel "Error relativo"
plot[:20][:] 'gregory/iteraciones-0-5000.dat' using 1:(erel($3)) title "Gregory"   with lines ls 1,\
              'machin/iteraciones-0-5000.dat' using 1:(erel($3)) title "Machin"    with lines ls 3,\
           'ramanujan/iteraciones-0-5000.dat' using 1:(erel($3)) title "Ramanujan" with lines ls 5

set logscale y
set output 'error-relativo-3iteraciones.eps'
set title  "Errores relativos de los algoritmos en los primeros 3 términos variando dígitos"
set xlabel "Dígitos"
set ylabel "Error relativo"
plot[:51][0.01:1] 'gregory/3iteraciones-truncamiento.dat' using 1:(erel($2)) title "Gregory (T)" with lines ls 1,\
           cota_greg(x) title "Cota Gregory = (54*2^{(1-t)})/13" with lines ls 8

#plot[:][:] 'gregory/3iteraciones-truncamiento.dat' using 1:(erel($2)) title "Gregory (T)"   with lines,\
#           'gregory/3iteraciones-redondeo.dat' using 1:(erel($2)) title "Gregory (R)"   with lines ,\
#            'machin/3iteraciones-truncamiento.dat' using 1:(erel($2)) title "Machin (T)"   with lines ,\
#            'machin/3iteraciones-redondeo.dat' using 1:(erel($2)) title "Machin (R)"   with lines,\
#            'ramanujan/3iteraciones-truncamiento.dat' using 1:(erel($2)) title "Ramanujan (T)"   with lines
#            'ramanujan/3iteraciones-redondeo.dat' using 1:(erel($2)) title "Ramanujan (R)"   with lines,\
#			cota_greg(x) title "Cota Gregory" with lines			cota_greg(x) title "Cota Gregory" with lines
